
export function yearsAndMonthsBetweenDates(startDate, endDate) {
  const startYear = startDate.getFullYear();
  const startMonth = startDate.getMonth() + 1; // JavaScript months are zero-indexed
  const endYear = endDate.getFullYear();
  const endMonth = endDate.getMonth() + 1;

  let years = endYear - startYear;
  let months = endMonth - startMonth;

  // Adjust for months that have passed in the current year
  if (months < 0) {
    years--;
    months += 12;
  }

  return { years, months };
}